package com.hamny.gwt.webrtc.client;

public class WebRTCFactory {

	public static final native RTCPeerConnection createRTCPeerConnection(
			RTCConfiguration configuration)
	/*-{
		if ($wnd.navigator.mozGetUserMedia) {
			return new mozRTCPeerConnection(configuration);
		} else if ($wnd.navigator.webkitGetUserMedia) {
			return new webkitRTCPeerConnection(configuration);
		}
		return new RTCPeerConnection(configuration);
	}-*/;

	public static final native RTCPeerConnection createRTCPeerConnection(
			RTCConfiguration configuration, MediaConstraints constraints)
	/*-{
		return new RTCPeerConnection(configuration, constraints);
	}-*/;

	public static final native RTCIceCandidate createRTCIceCandidate(
			RTCIceCandidate candidate)
	/*-{
		if ($wnd.navigator.mozGetUserMedia) {
			return new mozRTCIceCandidate(candidate);
		}
		return new RTCIceCandidate(candidate);
	}-*/;
}
